#ifndef FONTPROVIDER_H
#define FONTPROVIDER_H

#include <e32base.h>
#include <gdi.h>
#include <coemain.h>

template<class T, TBool StackOwnsEntry> class CStack;

#define DEFAULT_FONT_SIZE_PIXEL 14

class CFontProvider 
	: public CBase
{
public:
	~CFontProvider();
	CFontProvider();

public:
	const CFont& MakeFontL(TInt aFontSize
		, TBool aIsItalic = EFalse
		, TBool aIsBold = EFalse
		, TBool aIsAntiAliased = EFalse) const;

	inline const CFont& DefaultFontL() const;
	inline TInt DefaultFontHeightL() const;
	inline const CFont& MakeNormalFontL(TInt aFontSize);

private:
	mutable CFontCache* iCache;
};

inline const CFont& CFontProvider::DefaultFontL() const
{
	return MakeFontL(DEFAULT_FONT_SIZE_PIXEL);
}

inline TInt CFontProvider::DefaultFontHeightL() const
{
	return DefaultFontL().HeightInPixels();
}

inline const CFont& CFontProvider::MakeNormalFontL(TInt aFontSize)
{
	return MakeFontL(aFontSize, EFalse, EFalse, EFalse);
}

#endif // FONTMANAGER_H
